<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				padding: 0;
				margin: 0;
			}
			canvas{
				background: #272822;
				position: relative;
			}
		</style>
	</head>
	<body>
		<canvas id='canvas' width='800' height='500'></canvas>
		<script>
			//获得画板
			var canvas=document.getElementById('canvas');
			//获得绘画环境
			var cv=canvas.getContext('2d');
			
			cv.strokeStyle='yellow';
			cv.lineWidth=3;
			cv.strokeRect(0,0,100,100);
			//缩放画布
//			cv.scale(2,1);
//			cv.strokeRect(0,0,100,100);
//			
//			cv.scale(2,2);
//			cv.strokeRect(0,0,100,100);
			//平移画布
//			cv.translate(200,200);
//			cv.strokeRect(0,0,100,100);
			//旋转画布
			cv.rotate(30*Math.PI/180);
			cv.strokeRect(300,200,100,100);
		</script>
	</body>
</html>
